/**
 * Created by gengrong on 16/4/18.
 */
import { getFetchStatus } from 'actions/util';
import * as ReactRedux from 'react-redux';
import * as React from 'react';
import PureDevTeamManageList from '../components/dev-team-manage-list';
import * as DevTeamAction from 'actions/dev-team';

const mapStateToProps = (state) => {
  return {
    isFetching: getFetchStatus(state, DevTeamAction.search),
    users: state.devTeamList
  };
};

const mapDispatchToProps = (dispatch) => {
  return {
    initFetch: () => {
      return dispatch(DevTeamAction.search());
    },
    onSearchSubmit: (query) => {
      return dispatch(DevTeamAction.search(query));
    }
  };
};

class DevTeamManageList extends React.Component {
  componentDidMount() {
    this.props.initFetch();
  }

  render() {
    return <PureDevTeamManageList {...this.props}/>;
  }
}

export default ReactRedux.connect(mapStateToProps, mapDispatchToProps)(DevTeamManageList);
